﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using PefStudio.StartUp;

namespace PefStudio.Windows
{
    /// <summary>
    /// Interaction logic for AbstractToolBarItem.xaml
    /// </summary>
    public partial class AbstractToolBarItem : UserControl, IToolBarItem
    {
        public AbstractToolBarItem()
        {
            InitializeComponent();
        }

        [Import(Bootstrapper.MainWindowContract, typeof(Window))]
        private Lazy<MainWindow> mainWindow { get; set; }
        protected MainWindow MainWindow
        {
            get { return mainWindow.Value; }
        }

        public string ID { get; set; }
        public double Index { get; set; }
        public string InsertRelativeToID { get; set; }
        public bool BeforeRelativeID { get; set; }

        public virtual void ConditionEvaluate() { }

        public bool HasSeparator { get; set; }
        public Separator Separator { get; set; }

        private Window _parentWindow = null;
        public Window ParentWindow
        {
            get
            {
                return _parentWindow ?? MainWindow;
            }
            set { _parentWindow = value; }
        }
    }
}
